package cn.zxf.speedment_mysql.test_db.test_schema.position.generated;

import cn.zxf.speedment_mysql.test_db.test_schema.position.Position;
import com.speedment.common.annotation.GeneratedCode;
import com.speedment.runtime.config.identifier.ColumnIdentifier;
import com.speedment.runtime.config.identifier.TableIdentifier;
import com.speedment.runtime.field.LongField;
import com.speedment.runtime.field.StringField;
import com.speedment.runtime.typemapper.TypeMapper;

/**
 * The generated base for the {@link
 * cn.zxf.speedment_mysql.test_db.test_schema.position.Position}-interface
 * representing entities of the {@code position}-table in the database.
 * <p>
 * This file has been automatically generated by Speedment. Any changes made to
 * it will be overwritten.
 * 
 * @author Speedment
 */
@GeneratedCode("Speedment")
public interface GeneratedPosition {
    
    /**
     * This Field corresponds to the {@link Position} field that can be obtained
     * using the {@link Position#getId()} method.
     */
    LongField<Position, Long> ID = LongField.create(
        Identifier.ID,
        Position::getId,
        Position::setId,
        TypeMapper.primitive(), 
        true
    );
    /**
     * This Field corresponds to the {@link Position} field that can be obtained
     * using the {@link Position#getName()} method.
     */
    StringField<Position, String> NAME = StringField.create(
        Identifier.NAME,
        Position::getName,
        Position::setName,
        TypeMapper.identity(), 
        true
    );
    /**
     * This Field corresponds to the {@link Position} field that can be obtained
     * using the {@link Position#getDesc()} method.
     */
    StringField<Position, String> DESC = StringField.create(
        Identifier.DESC,
        Position::getDesc,
        Position::setDesc,
        TypeMapper.identity(), 
        false
    );
    
    /**
     * Returns the id of this Position. The id field corresponds to the database
     * column hellospeedment.hellospeedment.position.id.
     * 
     * @return the id of this Position
     */
    long getId();
    
    /**
     * Returns the name of this Position. The name field corresponds to the
     * database column hellospeedment.hellospeedment.position.name.
     * 
     * @return the name of this Position
     */
    String getName();
    
    /**
     * Returns the desc of this Position. The desc field corresponds to the
     * database column hellospeedment.hellospeedment.position.desc.
     * 
     * @return the desc of this Position
     */
    String getDesc();
    
    /**
     * Sets the id of this Position. The id field corresponds to the database
     * column hellospeedment.hellospeedment.position.id.
     * 
     * @param id to set of this Position
     * @return   this Position instance
     */
    Position setId(long id);
    
    /**
     * Sets the name of this Position. The name field corresponds to the
     * database column hellospeedment.hellospeedment.position.name.
     * 
     * @param name to set of this Position
     * @return     this Position instance
     */
    Position setName(String name);
    
    /**
     * Sets the desc of this Position. The desc field corresponds to the
     * database column hellospeedment.hellospeedment.position.desc.
     * 
     * @param desc to set of this Position
     * @return     this Position instance
     */
    Position setDesc(String desc);
    
    enum Identifier implements ColumnIdentifier<Position> {
        
        ID   ("id"),
        NAME ("name"),
        DESC ("desc");
        
        private final String columnName;
        private final TableIdentifier<Position> tableIdentifier;
        
        Identifier(String columnName) {
            this.columnName      = columnName;
            this.tableIdentifier = TableIdentifier.of(    getDbmsName(), 
                getSchemaName(), 
                getTableName());
        }
        
        @Override
        public String getDbmsName() {
            return "hellospeedment";
        }
        
        @Override
        public String getSchemaName() {
            return "hellospeedment";
        }
        
        @Override
        public String getTableName() {
            return "position";
        }
        
        @Override
        public String getColumnName() {
            return this.columnName;
        }
        
        @Override
        public TableIdentifier<Position> asTableIdentifier() {
            return this.tableIdentifier;
        }
    }
}